<script setup>
import GameCtrol from "./components/gameCtrol";
import { onMounted } from "Vue";

// import "./components/index";
// const food = new Food();
// console.log(food);

onMounted(() => {
  let gameCtrol = new GameCtrol();
  console.log("ppppp", gameCtrol);
});
</script>

<template>
  <main>
    <!--展示区域-->
    <div class="content">
      <div class="snake" id="snake">
        <div></div>
      </div>
      <div class="foot" id="foot">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
      </div>
    </div>
    <!--分数区域-->
    <div class="statistics">
      <span>分数:<span id="score">0</span></span>
      <span>等级:<span id="level">1</span></span>
    </div>
  </main>
</template>

<style>
* {
  padding: 0;
  margin: 0;
}
main {
  width: 360px;
  height: 420px;
  box-sizing: border-box;
  background: #b7d4a8;
  margin: 100px auto;
  border: 10px solid #000000;
  border-radius: 10px;
  display: flex;
  flex-flow: column;
  justify-content: space-around;
  align-items: center;
}
.content {
  width: 304px;
  height: 304px;
  border: 2px solid #000;
  position: relative;
}
.statistics {
  display: flex;
  width: 304px;
  justify-content: space-between;
}

.snake div {
  position: absolute;
  width: 10px;
  display: inline-block;
  height: 10px;
  background: #000;
  border: 1px solid #b7d4a8;
}
.snake div:first-child {
  background: rebeccapurple;
}
.foot {
  width: 10px;
  height: 10px;
  position: absolute;
  top: 40px;
  left: 100px;
  display: flex;
  flex-flow: wrap;
  justify-content: space-between;
  transform: rotate(45);
}
.foot > div {
  width: 4px;
  height: 4px;
  background: #000;
}
</style>
